﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Twitterizer;

namespace haber.classes
{
    public class twitterOauth
    {
        public const string AUTHORIZE = "https://api.twitter.com/oauth/authorize";
        public const string ACCESS_TOKEN = "https://api.twitter.com/oauth/access_token";
        public const string CALLBACK_URL = "http://www.sosyalmedyahaber.org/twitterCallBack.aspx";
        public const string REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token";

        private string _consumerKey = "";

        public string ConsumerKey
        {
            get { return "Uixujgt3UY2BPjzycScaxA"; }
            set { _consumerKey = value; }
        }


        private string _consumerSecret = "";

        public string ConsumerSecret
        {
            get { return "y9FJBHivhjj837WqH5w110Yl7eHPKIvCuxP9RmQXAXY"; }
            set { _consumerSecret = value; }
        }

        private string _token = "";

        public string Token
        {
            get { return _token; }
            set { _token = value; }
        }



        public void getRequest(string id)
        {
            OAuthTokenResponse oresponse = OAuthUtility.GetRequestToken(ConsumerKey, ConsumerSecret, CALLBACK_URL+"?id="+id);
            Token = oresponse.Token;

        }

        public String yonlendir()
        {
            return OAuthUtility.BuildAuthorizationUri(Token).ToString();
        }
    }
}